-- dark_force
-- create by zhuangsl
-- 黑暗原力，降低属性

return {
    apply = function(prop, baseValue)
        -- 提升的值
        local v = FormulaM.invoke("CALC_BIG_DIVISION", baseValue, prop[3], 1000);
        return baseValue - v;
    end,

    clear = function(who, prop)
        -- 处理血量还原
        if prop[2] ~= "hp" then
            return;
        end

        local force = prop[3];
        local currHp = who:getHp();
        local addHp = math.modf(force / (1000 - force) * currHp);
        who:setRealHp(currHp + addHp);
    end,

    record = function(target, prop, path)
        return false;
    end
};
